package com.hbpu.maven.spring.ioc.config;

import com.hbpu.maven.spring.ioc.bean.Person;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

@Configuration
public class PersonConfig {
    @Bean
//    @ConditionalOnBean(name = "dog")
    public Person person() {
        Person person = new Person();
        person.setName("make");
        person.setAge(21);
        person.setGender("男");
        System.out.println(2222222);
        return person;
    }

    @Bean("per")
    public Person per() {
        Person person = new Person();
        person.setName("mike");
        person.setAge(21);
        person.setGender("男");
        return person;
    }

}
